import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export let useDiff = defineStore('showDiff', () => {

    let show_diff = ref(false);
    let show_diff_getter = computed(() => show_diff.value);

    let diff_deviceno = ref("");
    let diff_deviceno_getter = computed(() => diff_deviceno.value);

    let diff_tagcode = ref("");
    let diff_tagcode_getter = computed(() => diff_tagcode.value);

    let diff_title=ref("");
    let diff_title_getter= computed(() => diff_title.value);

    function diff_deviceno_fn(data) {
        diff_deviceno.value = data   //必须使用.value
    };
    function diff_tagcode_fn(data) {
        diff_tagcode.value = data   //必须使用.value
    }
    function diff_title_fn(data){
        diff_title.value=data;
    }

    function show_diff_fn(status) {
        show_diff.value = status
    }

    



    return { show_diff_getter, diff_deviceno_getter, diff_tagcode_getter,diff_title_getter, diff_deviceno_fn, diff_tagcode_fn, show_diff_fn ,diff_title_fn}

});
